/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package FEMShapeFunctions;

import Integration.IFunction2D;

/**
 *
 * @author mark
 */
class SumFunctionShapeFunc2 implements IFunction2D{
    protected FEMShapeFunction2 f;
    protected int i,j;
    protected double kx,ky;

    public SumFunctionShapeFunc2(FEMShapeFunction2 f, int i, int j, double kx, double ky) {
        this.f = f;
        this.i = i;
        this.j = j;
        this.kx = kx;
        this.ky = ky;
    }

    public FEMShapeFunction2 getF() {
        return f;
    }

    public void setF(FEMShapeFunction2 f) {
        this.f = f;
    }

    public int getI() {
        return i;
    }

    public void setI(int i) {
        this.i = i;
    }

    public int getJ() {
        return j;
    }

    public void setJ(int j) {
        this.j = j;
    }

    public double getKx() {
        return kx;
    }

    public void setKx(double kx) {
        this.kx = kx;
    }

    public double getKy() {
        return ky;
    }

    public void setKy(double ky) {
        this.ky = ky;
    }

    public double calculate(double x, double y) {
        return f.calculateDerivatyXI(x, y,i)*f.calculateDerivatyXI(x, y,j)*kx + f.calculateDerivatyYI(x, y,i)*f.calculateDerivatyYI(x, y,j)*ky;
    }

    public double calculateDerivatyX(double x, double y) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public double calculateDerivatyY(double x, double y) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
